package com.situ.mall.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.mall.common.entity.Category;
import com.situ.mall.common.vo.CategoryVO;
import com.situ.mall.common.vo.IndexCategoryVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author kkkkkk
 * @since 2023-09-11
 */
public interface CategoryMapper extends BaseMapper<Category> {

    List<CategoryVO> tree();

    List<IndexCategoryVO> indexList();

    @Select("select * from category where parent_id = #{parentId} order by sequence desc limit 0,8")
    List<Category> select8(Integer parentId);
}
